package com.mk.cloud;

import act.Act;
import act.job.OnAppStart;
import com.mk.cloud.common.domain.GlArea;
import org.osgl.logging.L;
import org.osgl.logging.Logger;

import java.util.List;


@SuppressWarnings("unused")
public class Application {
    public final static int CACHE_TIME = 60 * 60 * 3;
    private final static String APPNAME = "PARTNER";
    public final static Logger LOG = L.get(APPNAME);
    public static List<GlArea> AREAS = null;

    public static void main(String[] args) throws Exception {
        Act.start(APPNAME);
    }

    @OnAppStart(async = true)
    public void appStarted() {
//        把区域数据放到全局缓存中，用于在发货时匹配区域编码使用 GlBuyersService.saveBuyerByOsOrder
        GlArea.Mapper glAreaMapper = Act.getInstance(GlArea.Mapper.class);
        AREAS = glAreaMapper.all();
    }
}
